<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" session="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>提现</title>

    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <!-- jqgrid-->
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/custom.ui.jqgrid.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">
	<link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/common.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/i18n/grid.locale-cn.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/jqGrid/js/minified/jquery.jqGrid.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/js/global.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script type="text/javascript"
            src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"></script>

    <style type="text/css">
		body{
			height:90%;
		}
       .wrapper{
       	  width:100%;
       }    
       .lt{
       	float:left;
       }
       .rt{
       	float:right;
       }
       .panel{
       		padding:20px;
       }
       .clearfix{
       		overflow:hidden;
       }
    .txt{
		color:#666;
		font-size:16px;
		height:34px;
		line-height:34px;
		width:150px;
		text-align:right;
		padding-right:20px;
	}
	 input{
	   display:inline-block;
	   height:30px;
	   width:140px;
	 *+line-height:30px;
	   border:none;
	   padding:0 20px 0 5px;
	   *+padding:0 5px;
	   text-align:left;
	   outline:none;
	}
	
	.wraper .btn-info{
		background:#228ded;
		border-color:#228ded;
		width:155px;
		height:36px;
		font-size:20px !important;
		line-height:18px;
		*+line-height:15px;
		outline:none;
	}
	.box{
		margin:30px 0;
		*+line-height:30px;
		line-height: 34px;
	}
	input[type="button"]{
		background:#fff;
	}
	.box label{
	   border:1px solid #ccc;
	   border-radius:2px;
	   padding:2px;
       line-height: 28px;
       width:150px;
	}
	.panel-default{
		border:none;
	}
    </style>
</head>
<body >
<div class="wrapper">
     <div class="">
          <div class="left_box">
         
          	<form action="">
			 	<div class="clearfix box">
			 		<div class="lt txt">手机号：</div><span style="font-size:16px;color:#666666">${walletTel_}</span>
			 	</div>
			 	<div class="clearfix box">
			 		<div class="lt txt">图片验证：</div><label class="lt"><input type="text" class="lt" placeholder="请输入图片验证" id="img_code"/></label><span class="" style="padding-left:40px;*+margin-right:120px;"><img id="authCode" src="" alt="" onclick="loadAuthCode()"/></span>
			 	</div>
			 	<div class="clearfix box">
			 		<div class="lt txt">验证码：</div><label  class="lt" style="position:relative;"><input type="text" class="lt" id="y_box"  placeholder="请输入验证码" />
			 		</label><input class="btn" type="button" id="yzm" onclick="getNumber(this)" style="margin-left:40px;width:100px;color:#45abf3 !important;*+margin-right:120px;" value="获取验证码"/>
			 	</div>
			 	<input type="button" class="btn btn-info" value="确认" onclick="next()" style="margin-left:150px;margin-top:0px; width:310px;height:40px;font-size:20px !important;background:#2e8ded !important;border-color:#2e8ded !important;"/>
	 		</form>
          </div>    
     </div>
     
 </div>
 <script type="text/javascript">
 parent.layer.style(parent.layer.index, {
                        height: 350,
						top:200
                     });
//parent.layer.iframeAuto(parent.layer.index);

 function getNumber(thisbtn){
	 var img_code=$("#img_code").val();
	 if(img_code==''){
		 layer.msg('图片验证不能为空');
		 return;
	 }
		 
		$.ajax({
	        type: "POST",
	        url: '/admin/userWallet_sendSms4RollOut.action',
	        data: "img_code="+img_code,
	        success: function (data) {
	            data = eval("(" + data + ")");
	            if(data.code=='1'){
	            	layer.msg('发送成功');
	            	var nums=60,tim="";
	        		var btn=thisbtn;
	        		btn.disabled=true;
	        		btn.value=nums+"秒后重试";
	        		var y_box=document.getElementById("y_box");
	        		y_box.removeAttribute("disabled");
	        		y_box.focus();
	        		tim=setInterval(del, 1000);
	        		function del(){
	        			nums--;
	        			if(nums>0){
	        				
	        				btn.value=nums+"秒后重试";
	        			}else{
	        				clearInterval(tim);
	        				btn.disabled=false;
	        				btn.value="获取验证码";
	        				nums=10;
	        			}
	        		}	            	
	            }else{
	            	layer.msg(data.msg);	
	            }
	        }
	    });
		
	}
 
 function next(){
	
	 var sms_code=$("#y_box").val();
	 if(sms_code==''){
		 layer.msg('验证码不能为空');
		 return;
	 }
	 var img_code=$("#img_code").val();
	 if(img_code==''){
		 layer.msg('图片验证不能为空');
		 return;
	 }
	 $.ajax({
        type: "POST",
        url: '/admin/userWallet_checkSms4RollOut.action',
        data: "sms_code="+sms_code+"&img_code="+img_code,
        success: function (data) {
            data = eval("(" + data + ")");
            if(data.code=='1'){
            	window.location = "${pageContext.request.contextPath}/admin/userWallet_rollOutChoiceWay.action"; 
				
            }else{
            	layer.msg(data.msg);	
            }
        }
    });
 }
 
 function loadAuthCode(){
	 var timestamp = Date.parse(new Date()); 
	 $("#authCode").attr('src','${pageContext.request.contextPath}/admin/common_genVerifyCode.action?func=FUNC_WALLET_ROLLOUT&h=36&random='+timestamp); 
	 
 }
 
 window.onload=function(){
	 loadAuthCode();
 }
 
 
 </script>
</body>
</html>
